<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@include file="/inner/head.jsp"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
<script>
	function add(){
		if(!$("#name").val()){
			jError("姓名不能为空",null, function(r){
				$("#name").focus();
			});
			return false;
		}
		else if(!$("#username").val()){
			jError("用户名不能为空",null, function(r){
				$("#username").focus();
			});
			return false;
		}
		else if(!$("#password").val()){
			jError("密码不能为空",null, function(r){
				$("#password").focus();
			});
			return false;
		}
		else if($("#confirmPassword").val()!=$("#password").val()){
			jError("二次密码不相同",null, function(r){
				$("#confirmPassword").val("");
				$("#confirmPassword").focus();
			});
			return false;
		}
		var url="${basepath}/userinfo?m=add";
		var options = {
			url: url,
			type: 'post',
			dataType: 'json',
			success: function(data){
				if(data!=null)
					jError(data.msg);
				else{
					jSuccess("添加成功!", null, function(r){
						userinfoform.reset();
						location.href="${basepath}/userinfo?m=search";
					});
	            }
			}
		};
		$("#userinfoform").ajaxSubmit(options);
	}
</script>
</head>
<body>
  <form id="userinfoform" name="userinfoform">
  <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" >
  	<tr>
      <td height="30">
      	<table width="100%" border="0" cellspacing="0" cellpadding="0">
      	  <tr>
        	<td height="24" bgcolor="#353c44">
        	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
          	    <tr>
            	  <td>
            	    <table width="100%" border="0" cellspacing="0" cellpadding="0">
              		  <tr>
                	    <td width="2%" height="19" valign="bottom"><div align="center"><img src="${basepath}/res/image/tb.gif" width="14" height="14" /></div></td>
                	    <td width="98%" valign="bottom"><span class="STYLE1"> 新增用户</span></td>
              		  </tr>
            	    </table>
            	  </td>
          	    </tr>
        	  </table>
            </td>
      	  </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td>
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
       	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">姓名：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="name" name="name" title="姓名"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">用户名：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="username" name="username" title="用户名"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">联系电话：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input id="tel" name="tel" title="联系电话"></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">密码：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input type="password" id="password" name="password" title="密码" style="width: 150px;"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td height="30" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">确认密码：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<input type="password" id="confirmPassword" name="confirmPassword" title="确定密码" style="width: 150px;"><font color="red">&nbsp;*</font></td>
      	  </tr>
      	  <tr>
        	<td width="20%" bgcolor="#FFFFFF" class="STYLE19" align="right">备注：</td>
        	<td bgcolor="#FFFFFF" class="STYLE19" align="left">&nbsp;<textarea rows="5" cols="40" id="remark" name="remark" style="margin-top: 5px;margin-bottom: 5px;" title="备注"></textarea> </td>
      	  </tr>
      	  <tr>
        	<td height="100" width="20%" bgcolor="#FFFFFF" class="STYLE19" align="center" colspan="2"> 
        	  <img src="${basepath}/res/image/tj.jpg" width="59" height="22" onclick="add();" title="提交" style="cursor: pointer;">
        	  <img src="${basepath}/res/image/cz.jpg" width="59" height="22" onclick="userinfoform.reset();" title="重置" style="cursor: pointer;">
        	</td>
      	  </tr>
  		</table>
  	  </td>
  	</tr>
  </table>
  </form>
</body>

